# encoding=utf-8
from pathlib import Path


class Route:
    def __init__(self):
        self.BASE_DIR = Path(__file__).resolve().parent.parent

    def common(self, filename='') -> str:
        """
        :param filename: 文件名 非必填 （不填写时，返回文件上一级目录，填写时，返回文件路径）
        :return: 返回目录或文件
        """

        COMMON = Path.joinpath(self.BASE_DIR, "common", filename)
        return COMMON

    def processingContext(self, filename='') -> str:
        PROCESSINGCONTEXT = Path.joinpath(self.BASE_DIR, 'processingContext', filename)
        return PROCESSINGCONTEXT

    def request(self, filename='') -> str:
        REQUEST = Path.joinpath(self.BASE_DIR, 'request', filename)
        return REQUEST

    def settings(self, filename='') -> str:
        SETTINGS = Path.joinpath(self.BASE_DIR, 'settings', filename)
        return SETTINGS

    def testcases(self, filename='') -> str:
        TESTCASES = Path.joinpath(self.BASE_DIR, 'testcases', filename)
        return TESTCASES

    def config(self, filename='') -> str:
        CONFIG = Path.joinpath(self.BASE_DIR, 'config', filename)
        return CONFIG

    def dataModels(self, filename='') -> str:
        DATAMODELS = Path.joinpath(self.BASE_DIR, 'dataModels', filename)
        return DATAMODELS

    def executionTestcases(self, filename='') -> str:
        EXECUTIONTESTCASES = Path.joinpath(self.BASE_DIR, 'executionTestcases', filename)
        return EXECUTIONTESTCASES

    def report(self, filename='') -> str:
        REPORT = Path.joinpath(self.BASE_DIR, 'report', filename)
        return REPORT

    def logs(self, filename='') -> str:
        LOGS = Path.joinpath(self.BASE_DIR, 'logs', filename)
        return LOGS

    def register_dataModels(self, filename='') -> str:
        REGISTER_DATAMODELS = Path.joinpath(self.BASE_DIR, 'register_dataModels', filename)
        return REGISTER_DATAMODELS

    def allure_results(self, filename='') -> str:
        ALLURE_REPORT = Path.joinpath(self.BASE_DIR, 'allure-results', filename)
        return ALLURE_REPORT

    def template(self, filename='') -> str:
        TEMPLATE = Path.joinpath(self.BASE_DIR, 'templates', filename)
        return TEMPLATE

    def email(self, filename='') -> str:
        EMAIL = Path.joinpath(self.BASE_DIR, 'emails', filename)
        return EMAIL


if __name__ == '__main__':
    print(Route().allure_results())
